import {onMounted, onUnmounted, reactive} from 'vue';

export default function(){
    let point = reactive({
        x: 0,
        y: 0
      })
  
      function clickPoint(event){
        point.x = event.pageX
        point.y = event.pageY
        console.log(event.pageX, event.pageY)
      }
  
      onMounted(() => {
        window.addEventListener('click', clickPoint)
      })
  
      onUnmounted(() => {
        window.removeEventListener('click', clickPoint)
      })
  
      return point
}


